package com.hzcrash.beauty;

import android.content.Context;
import android.os.Handler;
import android.os.Message;

import com.hzcrash.tools.RequestParams;

public class HBHandlerMeg
{
	private static Context h_context;
	public static Handler handler,back_handler;
	private static int h_cmd;
	private static int h_errocmd;
	private static int si;
	private static String cd;
	private static String ap;
	private static String pc;
	private static String pg;
	private static String ps;
	private static int cmd;
	private static int backcmd;

	public static Handler getHandler()
	{
		return handler;
	}
	public static Handler getBackHandler()
	{
		return back_handler;
	}

	public static void setHandler(Handler handler, int cmd, int erro_cmd, int _si, String _cd, String _ap, String _pc, String _pg,
			String _ps)
	{
		HBHandlerMeg.handler = handler;
		HBHandlerMeg.h_cmd = cmd;
		h_errocmd = erro_cmd;
		si = _si;
		cd = _cd;
		ap = _ap;
		pc = _pc;
		pg = _pg;
		ps = _ps;
	}

	public static void sendMsg(Context context)
	{
		h_context = context;
		if (handler != null)
		{
			switch (si)
			{
			case RequestParams.DATING_SI:
//				HBServiceApp service = new HBServiceApp(handler, h_context, h_cmd, h_errocmd);
//				service.dating_Mennage(cd, ap, pc, pg, ps);
				break;
			default:
				break;
			}
		}
	}

	public static void notifyUser(Message msg)
	{
	}

	public static void setHandler(Handler uiHandler, int uiCmd)
	{
		handler = uiHandler;
		cmd = uiCmd;
	}
	public static void setBackHandler(Handler handler,int cmd)
	{
		back_handler = handler;
		backcmd = cmd;
	}
	public static void sendMessage()
	{
		if (handler != null)
		{
			Message msg = new Message();
			msg.what = cmd;
			handler.sendMessage(msg);
		}
	}
	public static void sendBackMessage()
	{
		if (back_handler != null)
		{
			Message msg = new Message();
			msg.what = backcmd;
			back_handler.sendMessage(msg);
		}
	}
	public static void clearHandler()
	{
		handler = null;
		cmd = 0;
	}
	public static void clearBackHandler()
	{
		back_handler = null;
		backcmd = 0;
	}
}
